<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Notifier : test de l'API</title>
    <script src="js/jquery-1.2.3.js" type="text/javascript"></script>
    <script src="js/notifier.js" type="text/javascript"></script>
    <script src="js/wsse.js" type="text/javascript"></script>
    <script type="text/javascript">                                         
        $(document).ready(function() {
            notifier.prefs.baseUrl = prompt('Adresse du serveur ?', 'http://localhost/notifier/api/');
        });                                    
    </script>
    <link rel="stylesheet" type="text/css" media="screen" href="styles/main.css" />
</head>
<body>
<div id="container">
    <h1>Notifier : test de l'API</h1>
    <p id="loading" style="display:none;">Chargement</p>
    <div id="login">
        <label for="name">Identifiant</label>
        <input type="text" id="name" value="" />
        <label for="pwd">Mot de passe</label>
        <input type="password" id="pwd" value="" />
        <input type="submit" onclick="notifier.actions.login();" value="Connexion" />&nbsp;
        <a href="#" onclick="$('#login').hide();$('#register').show();">S'enregistrer</a> 
    </div>
    <div id="register" style="display:none;">
        <label for="reg_email">Email</label>
        <input type="text" id="reg_email" value="" />
        <label for="reg_name">Identifiant</label>
        <input type="text" id="reg_name" value="" />
        <label for="reg_pwd">Mot de passe</label>
        <input type="password" id="reg_pwd" value="" />
        <input type="submit" onclick="notifier.actions.register();" value="Créer un compte" />
    </div>
    <div id="main" style="display:none;">
        <div id="tabs">
            <a href="#" class="active" onclick="notifier.ui.showTab(this, 'friends-timeline'); notifier.actions.refreshFriendsTimeline();">Timeline</a>
            <a href="#" onclick="notifier.ui.showTab(this, 'friends'); notifier.actions.refreshFriendsList();">Friends</a>
            <a href="#" onclick="notifier.ui.showTab(this, 'favorites'); notifier.actions.refreshFavoritesList();">Favorites</a> 
        </div>
        <div id="friends-timeline-tab" class="tab">
            <h2>Timeline</h2>
            <textarea rows="8" cols="40" id="note_text"></textarea>
            <input type="submit" id="note_submit" onclick="notifier.actions.sendNote();" value="Envoyer" />
            <p class="refresh-link"><a href="#" onclick="notifier.actions.refreshFriendsTimeline();">Actualiser</a></p>
            <div id="friends-timeline"></div>
        </div>
        <div id="friends-tab" class="tab" style="display:none;">
            <h2>Friends</h2>
            <label for="friend_name">Ajouter un ami</label>
            <input type="text" id="friend_name" value="" />
            <input type="submit" id="friend_submit" onclick="notifier.actions.addFriend();" value="Ok" />
            <div id="friends-list"></div>
        </div>
        <div id="favorites-tab" class="tab" style="display:none;">
            <h2>Favorites</h2>
            <div id="favorites-list"></div>
        </div>
    </div>
</div>
</body>
</html>